package org.wdcode.web.mina.need;

import org.apache.mina.core.service.IoConnector;
import org.wdcode.common.constants.DateConstants;

/**
 * 指定Mina 连接器 需要用到的类 抽象实现
 * @author WD
 * @since JDK6
 * @version 1.0 2010-08-08
 */
public class BaseMinaConnectorNeed extends BaseMinaNeed implements MinaConnectorNeed {
	// 监听地址
	private String		host;
	// IO连接器
	private IoConnector	ioConnector;
	// 超时时间
	private long		connectTimeoutInMillis	= DateConstants.TIME_MINUTE;

	/**
	 * 获得监听地址
	 * @return 监听地址
	 */
	public final String getHost() {
		return host;
	}

	/**
	 * 设置监听地址
	 * @param host 监听地址
	 */
	public final void setHost(String host) {
		this.host = host;
	}

	/**
	 * 获得IO连接器
	 * @return IO连接器
	 */
	public final IoConnector getIoConnector() {
		return ioConnector;
	}

	/**
	 * 设置IO连接器
	 * @param ioConnector IO连接器
	 */
	public final void setIoConnector(IoConnector ioConnector) {
		this.ioConnector = ioConnector;
	}

	/**
	 * 设置超时时间 单位为毫秒 默认是1分钟
	 */
	public final void setConnectTimeoutMillis(long connectTimeoutInMillis) {
		this.connectTimeoutInMillis = connectTimeoutInMillis;
	}

	/**
	 * 获得超时时间
	 */
	public final long getConnectTimeoutMillis() {
		return connectTimeoutInMillis;
	}
}
